/*
* 通过方法来降低圈复杂度
* 现在classify的全复杂度通过Metrics计算得到为5
*/
public class Triangle {
    public  String classify(int a, int b, int c) {
        if (error(a,b,c)) {
            return "输入错误";
        }
        if (isNotTriangle(a,b,c)) {
            return "非三角形";
        } else if (scalene_test(a,b,c)) {
            return "不等边三角形";
        } else if(equalLaterialTriangle(a,b,c) ){
            return "等边三角形";}
        else {
            return "等腰三角形";
        }
    }
    public boolean error(int a,int b,int c){
        return a <1 || a>100 || b<1 || b>100 || c<1 || c> 100;
    }
    public boolean equalLaterialTriangle(int a,int b,int c){
        return a == b && a == c;
    }
    public boolean isNotTriangle(int a,int b,int c) {
        return !((a + b > c) && (a + c > b) && (b + c > a));
    }
    public boolean scalene_test(int a,int b,int c){
        return a != b && a != c && b != c;
    }
}
